package com.ymt.consumer.utils;

import com.ymt.consumer.domain.FinancialReceipts;
import com.ymt.enums.PayType;
import com.ymt.producer.domain.Order;

public class FinancialReceiptsFactory {
    public static FinancialReceipts create(Order order) {
        FinancialReceipts financialReceipts = new FinancialReceipts();
        financialReceipts.setOrderCode(order.getOrderCode());
        financialReceipts.setReceipt(order.getOrderPrice());
        financialReceipts.setSource(PayType.getPayType(order.getPayType()).getPayKey());
        return financialReceipts;
    }
}
